<template>
  <div id="app">
  <Header></Header>
  <router-view></router-view>
  <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>
<script>
import Header from '@/components/Header/Header.vue'
import Footer from '@/components/Footer/Footer.vue'
import {mapActions} from 'vuex'
export default {
  name:'',
  components:{
    Header,
    Footer
  },
  mounted(){
    //组件挂载发起请求，获取数据存储在仓库
    //使用命名空间必须加空间名
    //改造前
    // this.$store.dispatch("home/categoryList");
    
    //改造后
    this.list()
  },
  methods: {
    ...mapActions('home',{list:'categoryList'})
  },
}
</script>
<style lang="less">

</style>
